package pojo;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;

import helper.SQLConnection;

public class CRUDHelper {

	Connection conn = null;
	Statement st = null;
	ResultSet rs = null;

	public int insertANDupdateANDdel(String sql) {
		int temp = 0;
		conn = SQLConnection.getConn();
		System.out.print("--------------sql------" + sql);
		;
		try {
			st = conn.createStatement();
			temp = st.executeUpdate(sql);
		} catch (SQLException e) {
			// TODO �Զ����� catch ��
			e.printStackTrace();
			temp = -1;
		} finally {
			SQLConnection.close(conn, st, rs);
		}

		return temp;
	}

}
